﻿using Hotel.DAL;
using Hotel.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hotel.BLL
{
    public class MemberBLL
    {
        public MemberBLL(MemberDAL memberDAL)
        {
            MemberDAL = memberDAL;
        }

        public MemberDAL MemberDAL { get; }
        public int MebberAdd(Member member)
        {
            try
            {

                int res = MemberDAL.SerchPhoneCard(member.Phopne, member.Card);
                if (res==-1)
                {
                    return -1;
                }
                else if (res==-2)
                {
                    return -2;
                }
                else
                {
                    return MemberDAL.MebberAdd(member);
                }
            }
            catch (Exception)
            {

                throw;
            }
         
        }
    }
}
